<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center mine_flex_0"
			:style="{ height: (88 + StatusBarRpx) + 'rpx', paddingTop: StatusBarRpx + 'rpx' }">
			<view class='flex flex-wrap align-center justify-between flex-sub mine_fd0_0'>
				<view class='flex flex-wrap align-center justify-center mine_fd0_0_c0' @tap.stop="handleJumpDiy"
					data-type="back" data-url="1">
				</view>
				<view class='flex flex-wrap align-stretch justify-center'>
				</view>
				<view class='flex flex-wrap align-center mine_fd0_0_c2' @tap.stop="handleJumpDiy" data-type="navigateTo"
					:data-url="`/pages/main/platformMessage/platformMessage`">
					<image class='mine_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL + "20.png"'></image>
					<benben-message-num :messageNum="system_num" class='mine_fd0_0_c2_c1' size='24' color='#fff' background-color='red'>
					</benben-message-num>
				</view>
			</view>
		</view>

		<view class="flex flex-direction flex-wrap align-stretch justify-center benben-flex-layout mine_flex_1">
			<view class='flex align-center justify-between mine_fd1_0' @tap.stop="handleJumpDiy" data-type="navigateTo"
				:data-url="`/pages/main/myInformation/myInformation`" v-if="isLogin === true">
				<view class='flex flex-wrap align-center'>
					<image class='mine_fd1_0_c0_c0' mode="aspectFill" :src='userInfo.avatar'></image>
					<text class='mine_fd1_0_c0_c1'>{{ userInfo.real_name ? userInfo.real_name : userInfo.nickname }}</text>
				</view>
				<view class='flex flex-wrap align-center mine_fd1_0_c1'>
					<text class='mine_fd1_0_c1_c0'>我的资料</text>
					<image class='mine_fd1_0_c1_c1' mode="aspectFit" :src='STATIC_URL + "47.png"'></image>
				</view>
			</view>
			<view class='flex align-center justify-between mine_fd1_0' @tap.stop="handleJumpDiy" data-type="reLaunch"
				:data-url="`/pages/tabBar/login/login`" v-if="isLogin === false">
				<view class='flex flex-wrap align-center'>
					<image class='mine_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL + "81.png"'></image>
					<text class='mine_fd1_0_c0_c1'>请登录</text>
				</view>
			</view>
			<view class='flex flex-direction align-stretch justify-around mine_fd1_2'>
				<view class='flex flex-wrap align-center mine_fd1_2_c0'>
					<text class='mine_fd1_2_c0_c0'>学习档案</text>
				</view>
				<view class='flex align-center justify-center mine_fd1_2_c1'>
					<view class='flex flex-direction align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/main/learningRecord/learningRecord?type=1`">
						<image class='mine_fd1_2_c1_c0_c0' mode="aspectFit" :src='STATIC_URL + "45.png"'></image>
						<text class='mine_fd1_2_c1_c0_c1'>学习记录</text>
					</view>

					<view class='flex  mine_fd1_2_c1_c1'></view>

					<view class='flex flex-direction align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/main/learningRecord/learningRecord?type=2`">
						<image class='mine_fd1_2_c1_c0_c0' mode="aspectFit" :src='STATIC_URL + "46.png"'></image>
						<text class='mine_fd1_2_c1_c0_c1'>考试记录</text>
					</view>
				</view>
			</view>
		</view>


		<!---flex布局flex布局开始-->
		<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout mine_flex_2">
			<view class='flex flex-direction flex-wrap align-stretch mine_fd2_0'>
				<view class='flex flex-wrap align-center'>
					<text class='mine_fd2_0_c0_c0'>常用功能</text>
				</view>
				<view class='flex flex-wrap align-center mine_fd2_0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
					:data-url="`/pages/xtsz/feedBack/feedBack`">
					<image class='mine_fd2_0_c1_c0' mode="aspectFit" :src='STATIC_URL + "48.png"'></image>
					<text class='mine_fd2_0_c1_c1'>意见反馈</text>
					<image class='mine_fd2_0_c1_c2' mode="aspectFit" :src='STATIC_URL + "49.png"'></image>
				</view>
				<view class='flex flex-wrap align-center mine_fd2_0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
					:data-url="`/pages/xtsz/contactUs/contactUs`">
					<image class='mine_fd2_0_c1_c0' mode="aspectFit" :src='STATIC_URL + "50.png"'></image>
					<text class='mine_fd2_0_c1_c1'>联系我们</text>
					<image class='mine_fd2_0_c1_c2' mode="aspectFit" :src='STATIC_URL + "49.png"'></image>
				</view>
				<view class='flex flex-wrap align-center mine_fd2_0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
					:data-url="`/pages/xtsz/aboutUs/aboutUs`">
					<image class='mine_fd2_0_c1_c0' mode="aspectFit" :src='STATIC_URL + "51.png"'></image>
					<text class='mine_fd2_0_c1_c1'>关于我们</text>
					<image class='mine_fd2_0_c1_c2' mode="aspectFit" :src='STATIC_URL + "49.png"'></image>
				</view>
				<view class='flex flex-wrap align-center mine_fd2_0_c1' @tap.stop="cleanUpFunc()">
					<image class='mine_fd2_0_c1_c0' mode="aspectFit" :src='STATIC_URL + "52.png"'></image>
					<text class='mine_fd2_0_c1_c1'>清除缓存</text>
					<text class='mine_fd2_0_c4_c2'>{{appRubbishCacheSize}}</text>
					<image class='mine_fd2_0_c4_c3' mode="aspectFit" :src='STATIC_URL + "49.png"'></image>
				</view>
				<view class='flex flex-wrap align-center mine_fd2_0_c1' @tap.stop="updataFunc()">
					<image class='mine_fd2_0_c1_c0' mode="aspectFit" :src='STATIC_URL + "53.png"'></image>
					<text class='mine_fd2_0_c1_c1'>版本更新</text>
					<text class='mine_fd2_0_c4_c2'>{{appVersion}}</text>
					<image class='mine_fd2_0_c4_c3' mode="aspectFit" :src='STATIC_URL + "49.png"'></image>
				</view>
				<view class='flex flex-wrap align-center mine_fd2_0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
					:data-url="`/pages/xtsz/system/system`">
					<image class='mine_fd2_0_c1_c0' mode="aspectFit" :src='STATIC_URL + "54.png"'></image>
					<text class='mine_fd2_0_c1_c1'>设置</text>
					<image class='mine_fd2_0_c1_c2' mode="aspectFit" :src='STATIC_URL + "49.png"'></image>
				</view>
			</view>
		</view>
		
		<app-update ref="update"></app-update>

		<!---flex布局flex布局结束-->
		<benben-popup v-model="popupShow1686967413689" :mask="true" mode='center'>
			<!---清除缓存flex布局开始-->
			<view class="flex flex-direction flex-wrap align-center mine_flex_3"
				@tap.stop="popupShow1650940432200 = true">
				<text class='mine_fd3_0'>提示</text>
				<text class='mine_fd3_1'>确定要清除本地缓存？</text>
				<view class='flex flex-wrap align-center mine_fd3_2'>
					<button class='mine_fd3_2_c0' @tap.stop="popupShow1686967413689 = false">取消</button>
					<button class='mine_fd3_2_c1' @tap.stop="popupShow1686967413689 = false">确定</button>
				</view>
			</view>

			<!---清除缓存flex布局结束-->

		</benben-popup>


	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"popupShow1686967413689": false,
				"userInfo": {
					"invite_code": "",
					"address": "",
					"address_code": "",
					"hobby": "",
					"tags": "",
					"id": "",
					"lastid": "",
					"userlevel_id": "",
					"mobile": "",
					"real_name": "",
					"nickname": "",
					"avatar": "",
					"account": "",
					"email": "",
					"birthday": "",
					"gender": "",
					"create_time": "",
					"user_money": "",
					"freeze_money": "",
					"total_consumption_money": "",
					"score": "",
					"_mobile": "",
					"userlevel_name": "",
					"coupon": "",
					"collection_count": "",
					"browse_count": "",
					"follow_count": "",
					"total_money": "",
					"certified": "",
					"is_pay_password": "",
					"distributor_info": {
						"aid": "",
						"member_id": "",
						"uid": "",
						"create_time": "",
						"update_time": "",
						"sort": "",
						"is_del": "",
						"status": "",
						"create_id": "",
						"row_lock": "",
						"user_id": "",
						"inviter_id": "",
						"dis_path": "",
						"total_bonus": "",
						"inviter_num": "",
						"group_num": "",
						"self_sales": "",
						"inviter_sales": "",
						"group_sales": "",
						"distributorlevel_id": "",
						"level_name": ""
					}
				},
				"aid": "",
				"system_num": "0",  //消息未读数量
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			isLogin() {
				return this.$store.state.token == '' ? false : true;
			},
			appVersion() {
				// 获取版本号
				return this.$store.state.appVersion
			},
			appRubbishCacheSize() { // 获取缓存大小
				return this.$store.state.appRubbishCacheSize
			}
		},
		watch: {},
		onLoad(options) {
			console.log(this.appVersion);
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.$store.dispatch('getAppVersion') // 更新版本号
			this.$store.dispatch('getAppCache') // 更新缓存大小
			this.queryUserInfoFunc();
			this.getNewsNumber();
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取用户详细信息
			async queryUserInfoFunc() {
				if (this.isLogin === true) {
					//请求方法
					//数据验证
					let datauserInfo = await this.$api.post(global.apiUrls.post5c78c4772da97, {

					});

					if (datauserInfo.data.code != 1) {
						this.$message.info(datauserInfo.data.msg);
						return
					}
					let infouserInfo = datauserInfo.data;
					this.userInfo = infouserInfo.data;
					// this.$store.commit('saveToken', this.userInfo.user_token);
					// this.$store.commit('updateUserInfo', this.userInfo);
				}
			},
			// 获取消息未读数  post64abbd2825701
			getNewsNumber() {
				this.$api.post(global.apiUrls.post64abbd2825701, {
					
				}).then(res => {
					if (res.data.code == 1) {
						this.system_num = res.data.data.system_num;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			//清除缓存
			cleanUpFunc() {
				this.$store.dispatch('appClearCache');
			},
			//版本更新
			updataFunc() {
			
				this.$util.debounce(
					() => {
						this.$refs.update.checkAppUpdate()
					},
					1000,
					true
				)
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto !important;
	}

	.mine_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
	}

	.mine_fd0_0_c2_c1 {
		position: absolute;
		right: -10rpx;
		top: -10rpx;
	}

	.mine_fd0_0_c2_c0 {
		width: 48rpx;
		height: 48rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd0_0_c2 {
		width: 50rpx;
		height: 50rpx;
		position: relative;
	}

	.mine_fd0_0_c0 {
		width: 50rpx;
		height: 50rpx;
	}

	.mine_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.mine_flex_1 {
		background: url(/static/images/21.png) no-repeat, transparent;
		background-size: 100% auto !important;
		padding: 136rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd1_2_c1_c1 {
		background: rgba(225, 225, 225, 1);
		width: 1rpx;
		height: 74rpx;
		margin: 0rpx 146rpx 0rpx 146rpx;
		transform: scaleX(0.5);
	}

	.mine_fd1_2_c1_c0_c1 {
		padding: 13rpx 0rpx 0rpx 0rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #333333;
		line-height: 36rpx;
	}

	.mine_fd1_2_c1_c0_c0 {
		width: 60rpx;
		height: 60rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd1_2_c1 {
		background: #fff;
		background-size: 100% auto !important;
	}

	.mine_fd1_2_c0_c0 {
		color: #393939;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 45rpx;
	}

	.mine_fd1_2_c0 {
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.mine_fd1_2 {
		background: #fff;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 0rpx 32rpx 0rpx 32rpx;
		padding: 32rpx 24rpx 32rpx 24rpx;
	}

	.mine_fd1_0_c1_c1 {
		width: 24rpx;
		height: 24rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 15rpx;
	}

	.mine_fd1_0_c1_c0 {
		padding: 0rpx 0rpx 0rpx 8rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 33rpx;
	}

	.mine_fd1_0_c1 {
		line-height: 40rpx;
	}

	.mine_fd1_0_c0_c1 {
		margin: 0rpx 0rpx 0rpx 24rpx;
		font-size: 36rpx;
		font-weight: 500;
		color: #fff;
		max-width: 500rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.mine_fd1_0_c0_c0 {
		width: 104rpx;
		height: 104rpx;
		border-radius: 52rpx 52rpx 52rpx 52rpx;
	}

	.mine_fd1_0 {
		padding: 0rpx 40rpx 37rpx 40rpx;
	}

	.mine_flex_2 {
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin: 30rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd2_0_c4_c3 {
		width: 24rpx;
		height: 24rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd2_0_c4_c2 {
		color: #666666;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
		margin: 0rpx 020rpx 0rpx auto;
	}

	.mine_fd2_0_c1_c2 {
		width: 24rpx;
		height: 24rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.mine_fd2_0_c1_c1 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 700;
		line-height: 40rpx;
		margin: 0rpx 0rpx 0rpx 16rpx;
	}

	.mine_fd2_0_c1_c0 {
		width: 44rpx;
		height: 44rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd2_0_c1 {
		margin: 26rpx 0rpx 26rpx 0rpx;
	}

	.mine_fd2_0_c0_c0 {
		color: #393939;
		font-size: 32rpx;
		font-weight: 700;
		line-height: 45rpx;
	}

	.mine_fd2_0 {
		background: rgba(255, 255, 255, 1);
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 32rpx 24rpx 32rpx 24rpx;
	}

	.mine_flex_3 {
		background: #fff;
		width: 540rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.mine_fd3_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		line-height: 110rpx;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: rgba(205, 150, 45, 1);
		width: 270rpx;
	}

	.mine_fd3_2_c0 {
		border-top: 1px solid #eee;
		background: #fff;
		line-height: 110rpx;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		padding: 0rpx 103rpx 0rpx 103rpx;
	}

	.mine_fd3_2 {
		margin: 37rpx 0rpx 0rpx 0rpx;
	}

	.mine_fd3_1 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.mine_fd3_0 {
		font-size: 36rpx;
		font-weight: 800;
		line-height: 44rpx;
		color: #333333;
		margin: 40rpx 0rpx 40rpx 0rpx;
	}
</style>